home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / net / omniORB-2.5.0-src.tar.gz / omniORB-2.5.0-src.tar / omniORB_2.5.0 / include / omniORB2 / GIOP.h < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  118 lines

  1. // -*- Mode: C++; -*-
  2. //                            Package   : omniORB2
  3. // GIOP.h                     Created on: 8/2/96
  4. //                            Author    : Sai Lai Lo (sll)
  5. //
  6. //    Copyright (C) 1996, 1997 Olivetti & Oracle Research Laboratory
  7. //
  8. //    This file is part of the omniORB library
  9. //
  10. //    The omniORB library is free software; you can redistribute it and/or
  11. //    modify it under the terms of the GNU Library General Public
  12. //    License as published by the Free Software Foundation; either
  13. //    version 2 of the License, or (at your option) any later version.
  14. //
  15. //    This library is distributed in the hope that it will be useful,
  16. //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18. //    Library General Public License for more details.
  19. //
  20. //    You should have received a copy of the GNU Library General Public
  21. //    License along with this library; if not, write to the Free
  22. //    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
  23. //    02111-1307, USA
  24. //
  25. //
  26. // Description:
  27. //       C++ mapping of the OMG GIOP module
  28. //       Reference: CORBA V2.0 12.8.1
  29. //    
  30. //    
  31.  
  32. /*
  33.   $Log: GIOP.h,v $
  34.  * Revision 1.2  1997/05/06  16:06:27  sll
  35.  * Public release.
  36.  *
  37.  */
  38.  
  39. #ifndef __GIOP_H__
  40. #define __GIOP_H__
  41.  
  42. #include <omniORB2/CORBA_sysdep.h>
  43. #include <omniORB2/CORBA_basetypes.h>
  44. #include <omniORB2/IOP.h>
  45.  
  46. class GIOP {
  47. public:
  48.   enum MsgType {
  49.     Request = 0,                             // sent by client
  50.     Reply = 1,                               // by server
  51.     CancelRequest = 2,                       // by client
  52.     LocateRequest = 3,                       // by client
  53.     LocateReply = 4,                         // by server
  54.     CloseConnection = 5,                     // by server
  55.     MessageError = 6                         // by both
  56.   };
  57.  
  58.   struct Version {
  59.     _CORBA_Char major;
  60.     _CORBA_Char minor;
  61.   };
  62.  
  63.   struct MessageHeader {
  64.     _CORBA_Char         magic [4];              // "GIOP"
  65.     Version         GIOP_version;
  66.     _CORBA_Boolean   byte_order;          // 0 = big, 1 = little
  67.     _CORBA_Octet     message_type;
  68.     _CORBA_ULong     message_size;
  69.   };
  70.  
  71.   class RequestHeader {
  72.   public:
  73.     IOP::ServiceContextList    service_context;
  74.     _CORBA_ULong                request_id;
  75.     _CORBA_Boolean              response_expected;
  76.     _CORBA_Unbounded_Sequence_Octet object_key;
  77.     _CORBA_Char*                operation;
  78.     _CORBA_Unbounded_Sequence_Octet requesting_principal;
  79.   };
  80.  
  81.   enum ReplyStatusType {
  82.     NO_EXCEPTION,
  83.     USER_EXCEPTION,
  84.     SYSTEM_EXCEPTION,
  85.     LOCATION_FORWARD
  86.   };
  87.  
  88.   class ReplyHeader {
  89.   public:
  90.     IOP::ServiceContextList    service_context;
  91.     _CORBA_ULong                request_id;
  92.     ReplyStatusType             reply_status;
  93.   };
  94.  
  95.   struct CancelRequestHeader {
  96.     _CORBA_ULong  request_id;
  97.   };
  98.  
  99.   struct LocateRequestHeader {
  100.   public:
  101.     _CORBA_ULong          request_id;
  102.     _CORBA_Unbounded_Sequence_Octet object_key;
  103.   };
  104.  
  105.   enum LocateStatusType {
  106.     UNKNOWN_OBJECT,
  107.     OBJECT_HERE,
  108.     OBJECT_FORWARD
  109.   };
  110.  
  111.   struct LocateReplyHeader {
  112.     _CORBA_ULong    request_id;
  113.     LocateStatusType    locate_status;
  114.   };
  115. };
  116.  
  117. #endif // __GIOP_H__
  118.